﻿using PersonalWeekReport.Models.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.SqlTypes;
using System.Linq;
using System.Web;

namespace PersonalWeekReport.Models.Professional
{
    public class DailyWorkRecord
    {
        public Guid Id { set; get; }


        public Guid employeeId { set; get; }

        [ForeignKey("employeeId"),Display(Name ="员工")]
        public virtual Employee Employee { set; get; }

        [Display(Name = "日期"), DataType(DataType.Date)]
        public DateTime Date { set; get; }

        [Display(Name ="项目")]
        public string Project { set; get; }

        [Display(Name = "工作项"),StringLength(500),DataType(DataType.MultilineText)]
        public string Content { set; get; }

        [Display(Name ="执行结果")]
         public ContentResult Result{ set;get; }

        public DayOfWeek? weekday() {
           
                if (Date == null)
                {
                    return null;
                }
                else
                {
                    return this.Date.DayOfWeek;
                }
                
            
             }
    }

    public enum ContentResult
{
        完成,
        延期,
        进行中,
        终止,
        中止
}
}